var numStr =["zero","one","two","three","four","five","six","seven","eight","nine","ten"];
var decisionNum = 1;
var foreachNum = 1;
var joinNum = 1;
//通常配置:新增hjl,9-25,使编辑根据节点的顺序动态增加值
function updateState(states){
	var type=states.type;
	if(type=="decision"){
		states.text.text="exclusive"+decisionNum;
		states.props.expr.value="#{manager"+numStr[decisionNum++]+"}";
	}
	if(type=="task"){
		states.props.assignee.value="#{workno}";
		states.props.form.value="";
	}
	if(type=="join"){
		states.text.text="join"+joinNum;
		states.props.multiplicity.value="#{qumo"+numStr[joinNum++]+"}";
	}
	if(type=="foreach"){
		states.text.text="foreach"+foreachNum;
		states.props.in.value="#{worknos"+numStr[foreachNum++]+"}";
		states.props.var.value="workno";
	}	
}
//end-通常配置:新增hjl,9-25,使编辑根据节点的顺序动态增加值
(function($){
var myflow = $.myflow;

$.extend(true,myflow.config.rect,{
	attr : {
	r : 8,
	fill : '#F6F7FF',
	stroke : '#03689A',
	"stroke-width" : 2
}
});

$.extend(true,myflow.config.props.props,{
	name : {name:'name', label:'名称(name)',display:"hidden", value:'', editor:function(){return new myflow.editors.inputEditor();}},
	key : {name:'key', label:'标识(key)',value:'', editor:function(){return new myflow.editors.inputEditor();}}
	//,description : {name:'description', label:'描述(description)', display:"hidden",value:'', editor:function(){return new myflow.editors.inputEditor();}}
});


$.extend(true,myflow.config.tools.states,{
			start : {
				showType: 'image',
				type : 'start',
				name : {text:'<<start>>'},
				text : {text:'start1'},
				img : {src : 'img/jbpmDesign/48/start_event_empty.png',width : 48, height:48},
				attr : {width:50 ,heigth:50 },
				props : {
					text: {name:'text',label: '显示(name)',editor: function(){return new myflow.editors.textEditor();}, value:'start1'}
				}},
			end : {showType: 'image',type : 'end',
				name : {text:'<<end>>'},
				text : {text:'end1'},
				img : {src : 'img/jbpmDesign/48/end_event_terminate.png',width : 48, height:48},
				attr : {width:50 ,heigth:50 },
				props : {
					text: {name:'text',label: '显示', value:'', editor: function(){return new myflow.editors.textEditor();}, value:'end1'}
				}},
			foreach : {showType: 'image',type : 'foreach',
				name : {text:'<<foreach>>'},
				text : {text:''},
				img : {src : 'img/jbpmDesign/48/gateway_parallel.png',width :48, height:48},
				attr : {width:50 ,heigth:50 },
				props : {
					text: {name:'text', label: '显示(name)',editor: function(){return new myflow.editors.textEditor();}},
					in: {name:'in', label: '传入(in)',display:"hidden",editor: function(){return new myflow.editors.inputEditor();}},
					var: {name:'var', label : '变量(var)',display:"hidden",editor: function(){return new myflow.editors.selectEditor('select.json');}}
				}},
			join : {showType: 'image',type : 'join',
				name : {text:'<<join>>'},
				text : {text:''},
				img : {src : 'img/jbpmDesign/48/gateway_parallel.png',width :48, height:48},
				attr : {width:50 ,heigth:50 },
				props : {
					text: {name:'text', label: '显示(name)', editor: function(){return new myflow.editors.textEditor();}},
					multiplicity: {name:'multiplicity', label: '多样性(multiplicity)',display:"hidden", editor: function(){return new myflow.editors.inputShow();}}
				}},
			decision : {showType: 'image',type : 'decision',
				name : {text:'<<decision>>'},
				text : {text:''},
				img : {src : 'img/jbpmDesign/48/gateway_exclusive.png',width :48, height:48},
				attr : {width:50 ,heigth:50 },
				props : {
					text: {name:'text', label: '显示(name)',editor: function(){return new myflow.editors.textEditor();}},
					expr: {name:'expr', label: '表达式(expr)',display:"hidden",editor: function(){return new myflow.editors.inputEditor();}}
				}},				
			task : {showType: 'text',type : 'task',
				name : {text:'<<task>>'},
				text : {text:'任务'},
				img : {src : 'img/jbpmDesign/48/task_empty.png',width :48, height:48},
				props : {
					text: {name:'text', label: '显示(name)',editor: function(){return new myflow.editors.textEditor();}},
					assignee: {name:'assignee', label: '用户(assignee)',display:"hidden",editor: function(){return new myflow.editors.inputShow();}},
					form: {name:'form', label : '表单(form)',display:"hidden",editor: function(){return new myflow.editors.inputShow();}}
				}}
});
})(jQuery);	